﻿<UserControl  x:Class="WpfFeeCalculator.View.MoreFeesView"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <UserControl.Resources>
            <!--XmlDataProvider x:Key="CharacterData">
                <x:XData>
                    <Data xmlns="">
                        
                    </Data>
                </x:XData>
            </>
        <XmlDataProvider x:Key="ShorterData">
            <x:XData>
                <Data xmlns="">
                    
                    
                </Data>
            </x:XData>
        </XmlDataProvider-->
        <ControlTemplate x:Key="DetailedTemplate" TargetType="{x:Type ContentControl}">
                <Grid>
                    <Rectangle x:Name="background" RadiusX="9" RadiusY="9" Fill="Yellow" />
                    <StackPanel>
                        <TextBlock Margin="3,3,3,0" Text="{Binding Path=Name}" />
                    <Button Command="{Binding Path=DataContext.DeleteItemCommand,  RelativeSource={RelativeSource Mode=FindAncestor, 
                                 AncestorType={x:Type UserControl }}}" CommandParameter="{Binding Name}">
                        <Button.Content>
                            <Image Source="../resources/skullandcrossbones.jpg" Height="30" Width="30"/>
                        </Button.Content>
                    </Button>
                        <TextBlock Margin="3,0,3,7" Text="{Binding Path=FeeType}" />
                    </StackPanel>
                </Grid>
                <ControlTemplate.Triggers>
                    <DataTrigger Binding="{Binding Path=Gender}" Value="M">
                        <Setter Property="Fill" Value="LightBlue" TargetName="background"/>
                    </DataTrigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </UserControl.Resources>
        <StackPanel>
        <Button > Press Me</Button>  
            <ComboBox Name="cboScreenListing" Width="200"  
        VerticalAlignment="Top" HorizontalAlignment="Left"    
        HorizontalContentAlignment="Stretch"    
        SelectedItem="{Binding FeeId}"
        ItemsSource="{Binding FeeDetails}"
        IsEditable="True" IsReadOnly="True" Text="{Binding Path=FeeName}"
                      FontSize="16" 
             FontWeight="Normal"
             FontStyle="Oblique" >
            
                <!--ComboBox.ItemTemplate>
                    <DataTemplate>
                    <TextBlock  Text="{Binding Path=DataContext.FeeName,  RelativeSource={RelativeSource Mode=FindAncestor, 
                                 AncestorType={x:Type UserControl }}}" />
                    </DataTemplate>
                </-->
                <ComboBox.ItemContainerStyle>
                    <Style TargetType="{x:Type ComboBoxItem}">
                        <Setter Property="Margin" Value="5"/>
                        <Setter Property="Template" Value="{StaticResource DetailedTemplate}" />
                    </Style>
                </ComboBox.ItemContainerStyle>
            </ComboBox>
        </StackPanel>
  


</UserControl>
